//
//  ShopFootView.m
//  jianpai
//
//  Created by yrapp on 16/1/9.
//  Copyright © 2016年 yrapp. All rights reserved.
//

#import "ShopFootView.h"

@implementation ShopFootView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
 
        
//        UIImageView *imageBack = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kWidth, 45)];
//        imageBack.image = [UIImage imageNamed:@"brand_item_background"];
//        [self addSubview:imageBack];
        
        _selectButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _selectButton.frame = CGRectMake(10, 10, 85, 25);
        [_selectButton setImage:[UIImage imageNamed:@"check_box@2x"] forState:(UIControlStateNormal)];
        [_selectButton setTitle:@"全选" forState:(UIControlStateNormal)];
        _selectButton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 60);
        _selectButton.titleEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
        _selectButton.titleLabel.font = [UIFont systemFontOfSize:15.0];
        [_selectButton setTitleColor:[UIColor colorWithRed:81.0/255 green:91.0/255 blue:91.0/255 alpha:1]forState:(UIControlStateNormal)];
        [self addSubview:_selectButton];
        
        _clearButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _clearButton.frame = CGRectMake(kWidth - 90, 0, 90, 45);
        _clearButton.backgroundColor = [UIColor redColor];
        [_clearButton setTitle:@"结算" forState:(UIControlStateNormal)];
        [self addSubview:_clearButton];
        
        _allPriceLabel = [[UILabel alloc] initWithFrame:CGRectMake((kWidth - 100) / 2, 2, 100, 20)];
        _allPriceLabel.textColor = [UIColor redColor];
        _allPriceLabel.font = [UIFont systemFontOfSize:14.0];
        _allPriceLabel.textAlignment = NSTextAlignmentCenter;
        _allPriceLabel.text = @"总计: 0元";
        [self addSubview:_allPriceLabel];
        
        _privilegeLabel = [[UILabel alloc] initWithFrame:CGRectMake((kWidth - 100) / 2, 23, 100, 20)];
        _privilegeLabel.textColor = [UIColor grayColor];
        _privilegeLabel.font = [UIFont systemFontOfSize:14.0];
        _privilegeLabel.textAlignment = NSTextAlignmentCenter;
        _privilegeLabel.text = @"优惠: 0元";
        [self addSubview:_privilegeLabel];
        
        _removeButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _removeButton.frame = CGRectMake(kWidth - 65, 10, 60, 25);
        _removeButton.backgroundColor = [UIColor redColor];
        _removeButton.layer.masksToBounds = YES;
        _removeButton.layer.cornerRadius = 4;
        [_removeButton setTitle:@"删除" forState:(UIControlStateNormal)];
        _removeButton.titleLabel.font = [UIFont systemFontOfSize:13.0];
        _removeButton.hidden = YES;
        [self addSubview:_removeButton];
        
        _collectButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _collectButton.frame = CGRectMake(kWidth - _removeButton.frame.size.width - 95, 10,80,25);
        _collectButton.backgroundColor = [UIColor whiteColor];
        _collectButton.layer.cornerRadius = 4;
        [_collectButton setTitle:@"移到收藏夹" forState:(UIControlStateNormal)];
        [_collectButton setTitleColor:[UIColor colorWithRed:123.0/255 green:124.0/255 blue:125.0/255 alpha:1] forState:(UIControlStateNormal)];
        _collectButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
         _collectButton.hidden = YES;
        [self addSubview:_collectButton];
        
        _shareButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _shareButton.frame = CGRectMake(kWidth - _collectButton.frame.size.width - _removeButton.frame.size.width - 70 - 2 - 20, 10,70, 25);
        _shareButton.backgroundColor = [UIColor whiteColor];
        [_shareButton setTitle:@"分享" forState:(UIControlStateNormal)];
        _shareButton.layer.cornerRadius = 4;
        [_shareButton setTitleColor:[UIColor colorWithRed:123.0/255 green:124.0/255 blue:125.0/255 alpha:1] forState:(UIControlStateNormal)];
        _shareButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
         _shareButton.hidden = YES;
        [self addSubview:_shareButton];
        
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
